@extends('master')
@section('content')
<div class="management-content">
    <div class="container">
        <div class="record-list management-project">
            @if(Session::get('message'))
            <div class="alert alert-info" role="alert">{{ Session::get('message') }}</div>
            @endif @if(Session::get('error'))
            <div class="alert alert-danger" role="alert">{{ Session::get('error') }}</div>
            @endif

            <!-- Nav tabs -->
            <ul class="nav nav-tabs" role="tablist">
                <li class="active"><a href="#myProject" role="tab" data-toggle="tab">我的选片台</a>
                </li>
                <li><a href="#otherProject" role="tab" data-toggle="tab">他人的选片台</a>
                </li>
                <li><a href="#createProject" role="tab" data-toggle="tab">创建选片台</a>
                </li>
            </ul>

            <!-- Tab panes -->
            <div class="tab-content">
                <div class="tab-pane active" id="myProject">
                    <table class="table table-striped table-hover">
                        <thead>
                            <tr>
                                <th class="col-sm-2">项目名称</th>
                                <th class="col-sm-3">描述</th>
                                <th class="col-sm-5">选择的图片</th>
                                <th class="col-sm-2">操作</th>
                            </tr>
                        </thead>
                        <tbody>

                             @foreach ($projects as $project)
                            <tr>
                                <td>
                                    {{ $project->name }}
                                </td>
                                <td>
                                    {{ $project->name }}
                                </td>
                                <td>
                                   <ul>
                                    @foreach($project->pictures as $picture)
                                        <li>
                                        <a href="javascript:void(0);" data-remote="/picture/info/{{ $picture->id }}" data-toggle="modal" data-target="#photo-modal">
										   <img src="{{ '/uploads/picture/' . $picture->thumb }}" alt="">
									   </a>
                                        </li>
                                    @endforeach
                                    </ul>
                                </td>
                                <td>
                                   	<a href="javascript:void(0)" data-remote="/project/info/{{ $project->id }}" data-toggle="modal" data-target="#project-info-modal" class="btn btn-sm btn-info"><i class="glyphicon glyphicon-search"></i> 详情</a>
                                    <a href="/project/delete/{{ $project->id }}" class="btn btn-sm btn-danger"><i class="glyphicon glyphicon-trash"></i> 删除</a>
                                </td>
                            </tr>
                             @endforeach


                        </tbody>
                    </table>

                </div>
                <div class="tab-pane" id="otherProject">Other Project</div>

                <div class="tab-pane" id="createProject">
                   <div class="col-sm-8">
                       {{ Form::open(array('url' => '/project/create', 'role' => 'form')) }}
                           <div class="form-group">
                            {{ Form::label('name', 'Project Name') }}
                            {{ Form::text('name', '', array('class' => 'form-control')) }}
                           </div>
                            <div class="form-group">
                            {{ Form::label('description', 'Description') }}
                            {{ Form::textarea('description', '', array('class' => 'form-control')) }}
                            </div>
                            {{ Form::submit('提交', array('class' => 'btn btn-primary')) }}
                        {{ Form::close() }}
                   </div>
                </div>
            </div>
        </div>

    </div>
</div>
@stop




